﻿#ifndef __PROTOCOL_STRUCT_H_
#define __PROTOCOL_STRUCT_H_
#include "string.h" 
#include "stdbool.h" 
#include <stdint.h>
#define CMD_GET                         (0x0001)
#define CMD_SET                         (0x0002)
#define CMD_PUT                         (0x0003)
#define CMD_UPGRATE                     (0x0004)

//-------------------------CMD----------------------------	
#define CMD_REBOOT                      (5000)
#define CMD_UPGRADE                     (5001)
#define CMD_ADJUSTTIME 					(5002)
#define CMD_GETVERSION 					(5003)

#define CMD_TEST485 					(5004)
#define CMD_TEST485_2 					(5005)
#define CMD_TEST_IO                     (5006)
#define CMD_IMPORT_CFG 					(5007)
#define CMD_EXPORT_CFG 					(5008)
#define CMD_UPDATE_STATE 				(5009)
#define CMD_UPDATE_BASE 				(5010)

#define CMD_CAP_DATA					(5011)
#define CMD_SUB_DATA 					(5012)
#define CMD_GET_CPUID 					(5013)

#define CMD_SET_FLASH  					(5014)
#define CMD_GET_FLASH  					(5015)
#define CMD_SET_RDP    					(5016)
#define CMD_PUT_HEART  					(5017)
#define CMD_PUT_COM_DATA                (5018)
#define CMD_GET_DIDO 					(5019)
#define CMD_PET_DIDO 					(5020)

typedef struct put_s put_t;
typedef struct upgrade_s upgrade_t;
typedef struct cmd_s cmd_t;

#pragma pack(push,1)
struct put_s
{
	uint8_t* data;
	uint32_t len;
};
struct cmd_s
{
	uint8_t cmd;
	uint32_t pos;
	uint32_t len;
};
struct upgrade_s
{
	uint32_t pack_total;
	uint32_t pack_size;
};


#pragma pack(pop)

#endif //__PROTOCOL_STRUCT_H_
